package jrain.flow.engine.bean;

import java.util.HashMap;
import java.util.Map;

public class FlowInstance {

	private FlowDef flowDef;
	private String flowCode;
	private String fiId;
	private String startCode;
	private int version=0;
	private String oldFiId;
	private Map<String, Object> varMap = new HashMap<>();

	public FlowDef getFlowDef() {
		return flowDef;
	}

	public void setFlowDef(FlowDef flowDef) {
		this.flowDef = flowDef;
	}

	public String getFlowCode() {
		return flowCode;
	}

	public void setFlowCode(String flowCode) {
		this.flowCode = flowCode;
	}

	public String getFiId() {
		return fiId;
	}

	public void setFiId(String fiId) {
		this.fiId = fiId;
	}

	public String getStartCode() {
		return startCode;
	}

	public void setStartCode(String startCode) {
		this.startCode = startCode;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getOldFiId() {
		return oldFiId;
	}

	public void setOldFiId(String oldFiId) {
		this.oldFiId = oldFiId;
	}

	public Map<String, Object> getVarMap() {
		return varMap;
	}

	public void putVar(String key, Object value) {
		varMap.put(key, value);
	}

	public Object getVar(String key) {
		return varMap.get(key);
	}

	public Object removeVar(String key) {
		return varMap.get(key);
	}

	public void clearVar() {
		varMap.clear();
	}
}
